package com.lly.songhigh.entity.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lly.songhigh.entity.dao.Collection;
import com.lly.songhigh.entity.dao.AddTo;
import com.lly.songhigh.entity.dao.RecentPlay;
import com.lly.songhigh.entity.dao.RecentSearch;

import com.lly.songhigh.entity.dao.CollectionDao;
import com.lly.songhigh.entity.dao.AddToDao;
import com.lly.songhigh.entity.dao.RecentPlayDao;
import com.lly.songhigh.entity.dao.RecentSearchDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig collectionDaoConfig;
    private final DaoConfig addToDaoConfig;
    private final DaoConfig recentPlayDaoConfig;
    private final DaoConfig recentSearchDaoConfig;

    private final CollectionDao collectionDao;
    private final AddToDao addToDao;
    private final RecentPlayDao recentPlayDao;
    private final RecentSearchDao recentSearchDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        collectionDaoConfig = daoConfigMap.get(CollectionDao.class).clone();
        collectionDaoConfig.initIdentityScope(type);

        addToDaoConfig = daoConfigMap.get(AddToDao.class).clone();
        addToDaoConfig.initIdentityScope(type);

        recentPlayDaoConfig = daoConfigMap.get(RecentPlayDao.class).clone();
        recentPlayDaoConfig.initIdentityScope(type);

        recentSearchDaoConfig = daoConfigMap.get(RecentSearchDao.class).clone();
        recentSearchDaoConfig.initIdentityScope(type);

        collectionDao = new CollectionDao(collectionDaoConfig, this);
        addToDao = new AddToDao(addToDaoConfig, this);
        recentPlayDao = new RecentPlayDao(recentPlayDaoConfig, this);
        recentSearchDao = new RecentSearchDao(recentSearchDaoConfig, this);

        registerDao(Collection.class, collectionDao);
        registerDao(AddTo.class, addToDao);
        registerDao(RecentPlay.class, recentPlayDao);
        registerDao(RecentSearch.class, recentSearchDao);
    }
    
    public void clear() {
        collectionDaoConfig.getIdentityScope().clear();
        addToDaoConfig.getIdentityScope().clear();
        recentPlayDaoConfig.getIdentityScope().clear();
        recentSearchDaoConfig.getIdentityScope().clear();
    }

    public CollectionDao getCollectionDao() {
        return collectionDao;
    }

    public AddToDao getAddToDao() {
        return addToDao;
    }

    public RecentPlayDao getRecentPlayDao() {
        return recentPlayDao;
    }

    public RecentSearchDao getRecentSearchDao() {
        return recentSearchDao;
    }

}
